<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #div1 {
            width: 200px;
            height: 200px;
            border: 1px solid #000;
        }
    </style>
    
</head>
<body>
    <div id="div1" draggable="true">123</div>
    <script>
        const div1 = document.getElementById('div1');
        let timer = null;
        div1.addEventListener('drag', function (e) {
            if (timer) return;

            timer = setTimeout(() => {
                console.log(e.offsetX, e.offsetY);
                timer = null;
            }, 500);
        })
    </script>
</body>
</html>